package com.suny.sort_thread;

import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author Sunny
 * @date 2020/3/9
 */
public class SingleThreadTest {
    public static void main(String[] args) {
        ExecutorService executor = Executors.newSingleThreadExecutor();

        executor.execute(() -> {
            System.out.println("Thread1 - 执行");
        });

        executor.execute(() -> {
            System.out.println("Thread2 - 执行");
        });

        executor.shutdown();
    }
}
